window.addEvent("domready",function(){var k,l,b;$$(".ceraBoxHelp").cerabox({animation:"ease",displayTitle:!1,clickToClose:!1,displayOverlay:!0,preventScrolling:!1,loaderAtItem:!0,group:!1,events:{onOpen:function(c,b){document.pauseR=!0},onClose:function(c,b){document.pauseR=!1}},width:940,height:700});if(document.id("advancedsearch")){document.id("advancedsearch").getElement(".infobar").addEvent("click",function(){document.id("advancedsearch").toggleClass("collapsed");document.id("advancedsearch").getElement(".focusme").focus()});
$$(".choose").addEvent("click",function(){this.setStyle("display","none");document.id("exp-"+this.get("rel")).setStyle("display","block")});tblarray=[];a=[];var f;$$(".tbox").each(function(c,b){f=c.get("name");queryurl=c.get("queryurl");(selcols=c.getAttribute("selcols"))||(selcols=1);a[f]=null!=queryurl?new TextboxList(c,{unique:!0,bitsOptions:{editable:{addKeys:["|",";"]}},plugins:{autocomplete:{selWinCols:selcols,selWindow:!0,minLength:2,queryRemote:!0,placeholder:"Введите минимум два символа для подсказки",
remote:{url:queryurl,loadPlaceholder:"Загрузка..."}}}}):new TextboxList(c,{unique:!0,bitsOptions:{editable:{addKeys:["|",";"]}}});tblarray.push(a[f]);"sr_query"==f&&(c.textbox=a[f])});$$(".searchpaginator").addEvent("click",function(c){document.id("advancedsearch").set("action",document.id("advancedsearch").get("action")+"?p="+this.getAttribute("rel"));document.id("searchpaginator-qp").set("value",this.getAttribute("rel"));document.id("advancedsearch").submit();c.stop();c.preventDefault();return!1});
document.id("advancedgo").addEvent("click",function(){document.id("searchpaginator-qp").set("value",0)});document.id("advancedreset").addEvent("click",function(){$$('input[name="q"]').set("value","");document.id("sr_author").set("value","");document.id("sr_title").set("value","");document.id("sr_year").set("value","");a.sr_author.clearValues();a.sr_title.clearValues();a.sr_year.clearValues()})}if(document.id("elib-carousel")&&document.id("elib-carousel").hasClass("home")){b=document.id("elib-carousel");
if(!b.getElements(".item")[0])return;b.getElements(".center");b.getElements(".page");b.getElements(".go");var g=b.getElements(".goleft"),h=b.getElements(".goright"),e=b.getElements(".bul"),m=b.getProperty("pages"),n=b.getProperty("itemspp"),p=b.getElements(".item")[0].getDimensions().width,d=0,q=(new Fx.Morph("pageCar",{duration:500,link:"chain"})).start({left:0});h.addEvent("click",function(){this.hasClass("dis")||(d++,g[0<d?"removeClass":"addClass"]("dis"),h[d<m-1?"removeClass":"addClass"]("dis"),
q.start({left:-(d*n*p)}),e.removeClass("act"),e[d].addClass("act"))});g.addEvent("click",function(){this.hasClass("dis")||(d--,g[0<d?"removeClass":"addClass"]("dis"),h[d<m-1?"removeClass":"addClass"]("dis"),q.start({left:-(d*n*p)}),e.removeClass("act"),e[d].addClass("act"))});e.addEvent("click",function(){d=this.getProperty("rel");q.start({left:-(d*n*p)});e.removeClass("act");e[d].addClass("act");g[0<d?"removeClass":"addClass"]("dis");h[d<m-1?"removeClass":"addClass"]("dis")})}if((authlist=document.id("auth-list"))&&
(mode="authors")||(authlist=document.id("titles-list"))&&(mode="titles"))b=authlist.getElements("a"),authlist.getElements("div.oexp"),listMode="all",b.addEvent("click",function(c){actexpander=authlist.getElements("div.oexp.act");myexpander=this.getParent().getNext("div.oexp");myexpandercnt=myexpander.getElement("div.ajax-titles");myins=myexpander.getElement("ins");if(!myexpander.hasClass("act")){try{k=(new Fx.Morph(myexpander,{duration:250,link:"chain",transition:"sine:in:out"})).start({height:myexpander.getAttribute("loadheight"),
opacity:1}),myexpander.addClass("act")}catch(b){}try{(new Fx.Morph(actexpander[0],{duration:250,link:"chain",transition:"sine:in:out",onComplete:function(c){c.setStyle("display","none")}})).start({height:0,opacity:0}),actexpander.removeClass("act")}catch(d){}}try{(new Fx.Morph(myins,{duration:250,link:"chain",transition:"sine:in:out"})).start({left:this.getPosition(authlist).x+this.getDimensions().x/2-15})}catch(e){}myexpandercnt.set("tween",{duration:100,link:"chain"}).fade(0.4);myexpander.addClass("loading").setStyle("display",
"block");l&&l.cancel();l=(new Request({url:"titles"==mode?"/ajax/books-by-title/"+this.get("rel")+"/"+listMode+"/":"/ajax/titles-by-author/"+this.get("rel")+"/"+listMode+"/",link:"cancel",onComplete:function(b){myexpander.removeClass("loading");myexpandercnt.set("html",b).fade(1);zoomTips.attach(".publications-list .item .img");var d=myexpandercnt.getElement(".publications-list").getSize().y+18;k.start({height:d});setTimeout(function(){var b=myexpander.getPosition().y,e=window.getSize().y,f=window.getScroll().y;
b+d>e+f?(new Fx.Scroll(document)).start("",b-Math.max(0,(e-d-40)/2)-c.target.getSize().y-myins.getSize().y-8):c.target.getPosition().y-10<f&&(new Fx.Scroll(document)).start("",b-c.target.getSize().y-myins.getSize().y-8)},250)}})).send();return!1}),b=authlist.getElements("div.expander code"),b.addEvent("click",function(){var c=this.getParent("div.oexp");if(c.hasClass("act"))try{k=(new Fx.Morph(c,{duration:250,link:"chain",transition:"sine:in:out",onComplete:function(c){c.setStyle("display","none")}})).start({height:0,
opacity:0}),c.removeClass("act")}catch(b){}});zoomTips=new Tips(".publications-list .item .img",{className:"hlbarprev",onShow:function(c,b){c.set("tween",{duration:100});(img=c.getElement("img"))?img.set("src",b.getElement("img").src):img=(new Element("img",{src:b.getElement("img").src})).inject(c);c.fade(1)},onHide:function(c,b){c.fade(0)}});window.zoomTips=zoomTips});
